package com.bigevent.pojo;



import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {
    @NotNull // 通过Validated 实现参数的校验，必填
    private Integer id;//主键ID
    private String username;//用户名
    @JsonIgnore // 忽略该字段，不进行序列化
    private String password;//密码

    @NotEmpty // 通过Validated 实现参数的校验，必填，不为空
    @Pattern(regexp = "^\\S{1,10}$")
    private String nickname;//昵称

    @Email
    private String email;//邮箱
    private String userPic;//用户头像地址
    private LocalDateTime createTime;//创建时间
    private LocalDateTime updateTime;//更新时间

    @NotNull
    private String authority; // 权限等级
}
